package org.mch.swingm.core;

import java.awt.Dimension;

import javax.swing.JFileChooser;
import javax.swing.filechooser.FileNameExtensionFilter;

public class MFileChooser extends JFileChooser {
	private static final long serialVersionUID = 4701140124071481265L;

	public void setSelectFileType(String... fileTypes) {
		setSelectFileType("", fileTypes);
	}

	public void setSelectFileType(String desc, String... fileTypes) {
		removeChoosableFileFilter(getFileFilter());
		setFileFilter(new FileNameExtensionFilter(desc, fileTypes));
	}

	@Override
	public void setPreferredSize(Dimension preferredSize) {
		super.setPreferredSize(preferredSize);
	}

	public void setPreferredSize(int width, int height) {
		super.setPreferredSize(new Dimension(width, height));
	}
}
